/**
 * Created with JetBrains WebStorm.
 * User: Administrator
 * Date: 13-10-30
 * Time: 下午8:06
 * To change this template use File | Settings | File Templates.
 */
Ext.define("byb.controller.MenuController",{
   extend:"byb.controller.BaseController",
   functionItemClick:function(buttonObject){
       var container=Ext.getCmp("contentManager");
       if(container){
           container.removeAll();
       }
       var goToView=buttonObject.object.resource;
       Ext.getCmp("contentManager").add({
           xtype:goToView,
           border:false
       });
       var manager= this.queryWidgetByName(goToView);
       manager.setTitle(buttonObject.title+" -> "+buttonObject.object.name);
       
       
       var cls = "xp";
       Ext.each(Ext.ComponentQuery.query(".AccordionView ")[0].query("button"), function(object){
           // object.setAttribute("class","x-btn x-unselectable x-btn-byb-small x-noicon x-btn-noicon x-btn-byb-small-noicon");
           // object.style.background = "none";
    	   if(object.removeCls){
    		   object.removeCls(cls);
    	   }
       });
       
       
       buttonObject.button.addCls(cls);
       //buttonObject.button.dom.style.background = "url('resources/images/menu-foucs.png') no-repeat";
       
       
   }
});